package com.team.party.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ChangeDateAndString {
	public static SimpleDateFormat aDate=new SimpleDateFormat("yyyy-mm-dd");
	public static SimpleDateFormat bDate=new SimpleDateFormat("yyyy-mm-dd  HH:mm:ss");
	public static DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");         
	public static DateFormat format2 = new SimpleDateFormat("yyyy-mm-dd  HH:mm:ss");   
    
    public static String dateToString(Date date) {
    	return aDate.format(date);
    }
    
    public static Date stringToDate(String str) throws ParseException {
    	Date date = null;
    	date = format1.parse(str);
    	return date;
    }
}
